{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "from tools.config import CONFIG"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['aqi_score.csv']"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "folder_path = [i for i in os.listdir('./exam_data/') if 'score' in i]\n",
    "folder_path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>station</th>\n",
       "      <th>监测日期</th>\n",
       "      <th>IAQI_SO2_</th>\n",
       "      <th>IAQI_NO2_</th>\n",
       "      <th>IAQI_PM10_</th>\n",
       "      <th>IAQI_PM2.5_</th>\n",
       "      <th>IAQI_O3_</th>\n",
       "      <th>IAQI_CO_</th>\n",
       "      <th>首要污染物</th>\n",
       "      <th>MAX_AQI</th>\n",
       "      <th>IAQI_SO2__pred</th>\n",
       "      <th>IAQI_NO2__pred</th>\n",
       "      <th>IAQI_PM10__pred</th>\n",
       "      <th>IAQI_PM2.5__pred</th>\n",
       "      <th>IAQI_O3__pred</th>\n",
       "      <th>IAQI_CO__pred</th>\n",
       "      <th>首要污染物_pred</th>\n",
       "      <th>MAX_AQI_pred</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>2021-07-12</td>\n",
       "      <td>6.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>41</td>\n",
       "      <td>5.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>A</td>\n",
       "      <td>2021-07-10</td>\n",
       "      <td>7.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>41</td>\n",
       "      <td>6.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>A</td>\n",
       "      <td>2021-07-11</td>\n",
       "      <td>6.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>32</td>\n",
       "      <td>6.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>2021-07-12</td>\n",
       "      <td>5.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>21</td>\n",
       "      <td>7.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>B</td>\n",
       "      <td>2021-07-10</td>\n",
       "      <td>5.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>25</td>\n",
       "      <td>8.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2</td>\n",
       "      <td>B</td>\n",
       "      <td>2021-07-11</td>\n",
       "      <td>5.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>26</td>\n",
       "      <td>7.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>2021-07-12</td>\n",
       "      <td>6.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>36.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>62</td>\n",
       "      <td>8.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>45.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>83.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>83</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1</td>\n",
       "      <td>C</td>\n",
       "      <td>2021-07-10</td>\n",
       "      <td>10.0</td>\n",
       "      <td>28.0</td>\n",
       "      <td>53.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>133.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>133</td>\n",
       "      <td>8.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>44.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>81.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2</td>\n",
       "      <td>C</td>\n",
       "      <td>2021-07-11</td>\n",
       "      <td>7.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>99.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>99</td>\n",
       "      <td>8.0</td>\n",
       "      <td>37.0</td>\n",
       "      <td>46.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>73.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>O3_</td>\n",
       "      <td>73</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Unnamed: 0 station        监测日期  IAQI_SO2_  IAQI_NO2_  IAQI_PM10_  \\\n",
       "0           0       A  2021-07-12        6.0       15.0        16.0   \n",
       "1           1       A  2021-07-10        7.0       17.0        20.0   \n",
       "2           2       A  2021-07-11        6.0       14.0        20.0   \n",
       "3           0       B  2021-07-12        5.0       10.0        18.0   \n",
       "4           1       B  2021-07-10        5.0       12.0        20.0   \n",
       "5           2       B  2021-07-11        5.0        9.0        17.0   \n",
       "6           0       C  2021-07-12        6.0       23.0        36.0   \n",
       "7           1       C  2021-07-10       10.0       28.0        53.0   \n",
       "8           2       C  2021-07-11        7.0       24.0        31.0   \n",
       "\n",
       "   IAQI_PM2.5_  IAQI_O3_  IAQI_CO_ 首要污染物  MAX_AQI  IAQI_SO2__pred  \\\n",
       "0          6.0      41.0      10.0   O3_       41             5.0   \n",
       "1          8.0      41.0      10.0   O3_       41             6.0   \n",
       "2          4.0      32.0       9.0   O3_       32             6.0   \n",
       "3          5.0      21.0      15.0   O3_       21             7.0   \n",
       "4         11.0      25.0      13.0   O3_       25             8.0   \n",
       "5          6.0      26.0      13.0   O3_       26             7.0   \n",
       "6         23.0      62.0      12.0   O3_       62             8.0   \n",
       "7         49.0     133.0      15.0   O3_      133             8.0   \n",
       "8         15.0      99.0      11.0   O3_       99             8.0   \n",
       "\n",
       "   IAQI_NO2__pred  IAQI_PM10__pred  IAQI_PM2.5__pred  IAQI_O3__pred  \\\n",
       "0            33.0             29.0              19.0           40.0   \n",
       "1            25.0             31.0              19.0           56.0   \n",
       "2            29.0             31.0              20.0           49.0   \n",
       "3            13.0             21.0              12.0           32.0   \n",
       "4            15.0             24.0              14.0           34.0   \n",
       "5            15.0             24.0              13.0           32.0   \n",
       "6            35.0             45.0              32.0           83.0   \n",
       "7            35.0             44.0              30.0           81.0   \n",
       "8            37.0             46.0              32.0           73.0   \n",
       "\n",
       "   IAQI_CO__pred 首要污染物_pred  MAX_AQI_pred  \n",
       "0           15.0        O3_            40  \n",
       "1           13.0        O3_            56  \n",
       "2           14.0        O3_            49  \n",
       "3           12.0        O3_            32  \n",
       "4           11.0        O3_            34  \n",
       "5           12.0        O3_            32  \n",
       "6           17.0        O3_            83  \n",
       "7           16.0        O3_            81  \n",
       "8           18.0        O3_            73  "
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('./exam_data/'+folder_path[0])\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['/home/wuxiang/data-vol-1/comptetition/mycode/tools/../../mycode/models/models_for_3_xgb']"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "folder_path = [os.path.join(CONFIG().MODEL_ROOT, i) for i in os.listdir(CONFIG().MODEL_ROOT) if 'model' in i]\n",
    "folder_path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>场站</th>\n",
       "      <th>label</th>\n",
       "      <th>test_maxError</th>\n",
       "      <th>test_MSE</th>\n",
       "      <th>train_maxError</th>\n",
       "      <th>train_MSE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>SO2_</td>\n",
       "      <td>15.664359</td>\n",
       "      <td>5.571237</td>\n",
       "      <td>12.017053</td>\n",
       "      <td>2.459775</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>NO2_</td>\n",
       "      <td>61.165222</td>\n",
       "      <td>117.312208</td>\n",
       "      <td>117.121468</td>\n",
       "      <td>136.094202</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>PM10_</td>\n",
       "      <td>52.428699</td>\n",
       "      <td>165.273364</td>\n",
       "      <td>112.582222</td>\n",
       "      <td>196.465656</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>PM2.5_</td>\n",
       "      <td>43.840923</td>\n",
       "      <td>75.938085</td>\n",
       "      <td>65.938698</td>\n",
       "      <td>80.349978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>O3_</td>\n",
       "      <td>242.476440</td>\n",
       "      <td>871.068786</td>\n",
       "      <td>138.061447</td>\n",
       "      <td>414.738824</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>CO_</td>\n",
       "      <td>0.507353</td>\n",
       "      <td>0.033787</td>\n",
       "      <td>0.658385</td>\n",
       "      <td>0.011907</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>SO2_</td>\n",
       "      <td>5.497798</td>\n",
       "      <td>3.534639</td>\n",
       "      <td>5.723355</td>\n",
       "      <td>1.364717</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>NO2_</td>\n",
       "      <td>42.863142</td>\n",
       "      <td>73.156154</td>\n",
       "      <td>79.126263</td>\n",
       "      <td>61.418610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>PM10_</td>\n",
       "      <td>71.890053</td>\n",
       "      <td>163.137420</td>\n",
       "      <td>142.953461</td>\n",
       "      <td>173.290380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>PM2.5_</td>\n",
       "      <td>24.740257</td>\n",
       "      <td>26.563999</td>\n",
       "      <td>67.363407</td>\n",
       "      <td>39.829398</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>O3_</td>\n",
       "      <td>137.494652</td>\n",
       "      <td>493.102473</td>\n",
       "      <td>95.713135</td>\n",
       "      <td>322.254712</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>CO_</td>\n",
       "      <td>0.418070</td>\n",
       "      <td>0.013386</td>\n",
       "      <td>0.416007</td>\n",
       "      <td>0.007274</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>SO2_</td>\n",
       "      <td>10.118418</td>\n",
       "      <td>7.793165</td>\n",
       "      <td>13.385376</td>\n",
       "      <td>2.140238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>NO2_</td>\n",
       "      <td>48.784592</td>\n",
       "      <td>85.012372</td>\n",
       "      <td>79.282501</td>\n",
       "      <td>72.288013</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>PM10_</td>\n",
       "      <td>61.243279</td>\n",
       "      <td>389.868290</td>\n",
       "      <td>101.329250</td>\n",
       "      <td>247.396797</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>PM2.5_</td>\n",
       "      <td>61.625786</td>\n",
       "      <td>110.696881</td>\n",
       "      <td>82.090775</td>\n",
       "      <td>106.759792</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>O3_</td>\n",
       "      <td>139.051384</td>\n",
       "      <td>801.353230</td>\n",
       "      <td>105.434509</td>\n",
       "      <td>381.218726</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>CO_</td>\n",
       "      <td>0.613495</td>\n",
       "      <td>0.019950</td>\n",
       "      <td>1.492160</td>\n",
       "      <td>0.018056</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Unnamed: 0 场站   label  test_maxError    test_MSE  train_maxError  \\\n",
       "0            0  A    SO2_      15.664359    5.571237       12.017053   \n",
       "1            0  A    NO2_      61.165222  117.312208      117.121468   \n",
       "2            0  A   PM10_      52.428699  165.273364      112.582222   \n",
       "3            0  A  PM2.5_      43.840923   75.938085       65.938698   \n",
       "4            0  A     O3_     242.476440  871.068786      138.061447   \n",
       "5            0  A     CO_       0.507353    0.033787        0.658385   \n",
       "6            0  B    SO2_       5.497798    3.534639        5.723355   \n",
       "7            0  B    NO2_      42.863142   73.156154       79.126263   \n",
       "8            0  B   PM10_      71.890053  163.137420      142.953461   \n",
       "9            0  B  PM2.5_      24.740257   26.563999       67.363407   \n",
       "10           0  B     O3_     137.494652  493.102473       95.713135   \n",
       "11           0  B     CO_       0.418070    0.013386        0.416007   \n",
       "12           0  C    SO2_      10.118418    7.793165       13.385376   \n",
       "13           0  C    NO2_      48.784592   85.012372       79.282501   \n",
       "14           0  C   PM10_      61.243279  389.868290      101.329250   \n",
       "15           0  C  PM2.5_      61.625786  110.696881       82.090775   \n",
       "16           0  C     O3_     139.051384  801.353230      105.434509   \n",
       "17           0  C     CO_       0.613495    0.019950        1.492160   \n",
       "\n",
       "     train_MSE  \n",
       "0     2.459775  \n",
       "1   136.094202  \n",
       "2   196.465656  \n",
       "3    80.349978  \n",
       "4   414.738824  \n",
       "5     0.011907  \n",
       "6     1.364717  \n",
       "7    61.418610  \n",
       "8   173.290380  \n",
       "9    39.829398  \n",
       "10  322.254712  \n",
       "11    0.007274  \n",
       "12    2.140238  \n",
       "13   72.288013  \n",
       "14  247.396797  \n",
       "15  106.759792  \n",
       "16  381.218726  \n",
       "17    0.018056  "
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "file_path0 = os.path.join(folder_path[0], 'performances_base.csv')\n",
    "df0 = pd.read_csv(file_path0)\n",
    "df0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>场站</th>\n",
       "      <th>label</th>\n",
       "      <th>test_maxError</th>\n",
       "      <th>test_MSE</th>\n",
       "      <th>train_maxError</th>\n",
       "      <th>train_MSE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>SO2_</td>\n",
       "      <td>0.422144</td>\n",
       "      <td>0.221707</td>\n",
       "      <td>-6.872675</td>\n",
       "      <td>-2.134458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>NO2_</td>\n",
       "      <td>-5.579433</td>\n",
       "      <td>2.808306</td>\n",
       "      <td>-79.328606</td>\n",
       "      <td>-115.569343</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>PM10_</td>\n",
       "      <td>9.534664</td>\n",
       "      <td>8.741500</td>\n",
       "      <td>-54.090630</td>\n",
       "      <td>-165.597530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>PM2.5_</td>\n",
       "      <td>-3.106281</td>\n",
       "      <td>6.092149</td>\n",
       "      <td>-40.880257</td>\n",
       "      <td>-69.763403</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>O3_</td>\n",
       "      <td>2.376343</td>\n",
       "      <td>27.536732</td>\n",
       "      <td>-91.482971</td>\n",
       "      <td>-363.274435</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>CO_</td>\n",
       "      <td>-0.012864</td>\n",
       "      <td>-0.000218</td>\n",
       "      <td>-0.209502</td>\n",
       "      <td>-0.005862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>SO2_</td>\n",
       "      <td>0.015687</td>\n",
       "      <td>0.307627</td>\n",
       "      <td>-3.020655</td>\n",
       "      <td>-1.167720</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>NO2_</td>\n",
       "      <td>-1.195875</td>\n",
       "      <td>4.410160</td>\n",
       "      <td>-51.851002</td>\n",
       "      <td>-50.216461</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>PM10_</td>\n",
       "      <td>1.082947</td>\n",
       "      <td>23.084696</td>\n",
       "      <td>-102.023315</td>\n",
       "      <td>-147.205599</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>PM2.5_</td>\n",
       "      <td>5.897717</td>\n",
       "      <td>5.863383</td>\n",
       "      <td>-47.426182</td>\n",
       "      <td>-33.898254</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>O3_</td>\n",
       "      <td>-9.533852</td>\n",
       "      <td>23.683004</td>\n",
       "      <td>-40.711006</td>\n",
       "      <td>-280.145218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0</td>\n",
       "      <td>B</td>\n",
       "      <td>CO_</td>\n",
       "      <td>0.026706</td>\n",
       "      <td>0.000549</td>\n",
       "      <td>-0.065492</td>\n",
       "      <td>-0.002933</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>SO2_</td>\n",
       "      <td>-1.045337</td>\n",
       "      <td>-0.159201</td>\n",
       "      <td>-8.647511</td>\n",
       "      <td>-1.773175</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>NO2_</td>\n",
       "      <td>-4.158897</td>\n",
       "      <td>3.789710</td>\n",
       "      <td>-43.471512</td>\n",
       "      <td>-59.645489</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>PM10_</td>\n",
       "      <td>1.465597</td>\n",
       "      <td>12.077147</td>\n",
       "      <td>-46.414318</td>\n",
       "      <td>-206.306972</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>PM2.5_</td>\n",
       "      <td>9.376068</td>\n",
       "      <td>1.916914</td>\n",
       "      <td>-39.093044</td>\n",
       "      <td>-86.094363</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>O3_</td>\n",
       "      <td>18.892525</td>\n",
       "      <td>-5.905771</td>\n",
       "      <td>-57.923851</td>\n",
       "      <td>-330.368249</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0</td>\n",
       "      <td>C</td>\n",
       "      <td>CO_</td>\n",
       "      <td>0.009572</td>\n",
       "      <td>0.000374</td>\n",
       "      <td>-0.796277</td>\n",
       "      <td>-0.010328</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Unnamed: 0 场站   label  test_maxError   test_MSE  train_maxError  \\\n",
       "0            0  A    SO2_       0.422144   0.221707       -6.872675   \n",
       "1            0  A    NO2_      -5.579433   2.808306      -79.328606   \n",
       "2            0  A   PM10_       9.534664   8.741500      -54.090630   \n",
       "3            0  A  PM2.5_      -3.106281   6.092149      -40.880257   \n",
       "4            0  A     O3_       2.376343  27.536732      -91.482971   \n",
       "5            0  A     CO_      -0.012864  -0.000218       -0.209502   \n",
       "6            0  B    SO2_       0.015687   0.307627       -3.020655   \n",
       "7            0  B    NO2_      -1.195875   4.410160      -51.851002   \n",
       "8            0  B   PM10_       1.082947  23.084696     -102.023315   \n",
       "9            0  B  PM2.5_       5.897717   5.863383      -47.426182   \n",
       "10           0  B     O3_      -9.533852  23.683004      -40.711006   \n",
       "11           0  B     CO_       0.026706   0.000549       -0.065492   \n",
       "12           0  C    SO2_      -1.045337  -0.159201       -8.647511   \n",
       "13           0  C    NO2_      -4.158897   3.789710      -43.471512   \n",
       "14           0  C   PM10_       1.465597  12.077147      -46.414318   \n",
       "15           0  C  PM2.5_       9.376068   1.916914      -39.093044   \n",
       "16           0  C     O3_      18.892525  -5.905771      -57.923851   \n",
       "17           0  C     CO_       0.009572   0.000374       -0.796277   \n",
       "\n",
       "     train_MSE  \n",
       "0    -2.134458  \n",
       "1  -115.569343  \n",
       "2  -165.597530  \n",
       "3   -69.763403  \n",
       "4  -363.274435  \n",
       "5    -0.005862  \n",
       "6    -1.167720  \n",
       "7   -50.216461  \n",
       "8  -147.205599  \n",
       "9   -33.898254  \n",
       "10 -280.145218  \n",
       "11   -0.002933  \n",
       "12   -1.773175  \n",
       "13  -59.645489  \n",
       "14 -206.306972  \n",
       "15  -86.094363  \n",
       "16 -330.368249  \n",
       "17   -0.010328  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "file_path = os.path.join(folder_path[0], 'performances.csv')\n",
    "df = pd.read_csv(file_path)\n",
    "indexs = ['test_maxError','test_MSE', 'train_maxError', 'train_MSE']\n",
    "df[indexs] = df[indexs] - df0[indexs]\n",
    "df"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
